import  mysql.connector

conn=mysql.connector.connect(user="root",password="132786",database="members")

cursor=conn.cursor()

cursor.execute("select * from userinfo ")
#将所有数据拿出来
x=cursor.fetchall()

print(x)

for i in x:
    print(i)

cursor.close()
conn.close()
















# import mysql.connector
# conn = mysql.connector.connect(user='root', password='password', database='members')
# cursor = conn.cursor()

# cursor.execute('select * from userInfo')

# values = cursor.fetchall()
# print(values)

# for x in values :
#     print(x)

# cursor.close()
# conn.close()